package com.example.query.dto;

import lombok.Data;
import java.util.List;

@Data
public class QueryRequest {
    private Integer page = 1;
    private Integer pageSize = 10;
    private String tableName;
    private List<String> fields;
    private List<QueryCondition> conditions;
    private List<SortField> sorts;

    public Integer getPage() {
        return page == null || page < 1 ? 1 : page;
    }

    public Integer getPageSize() {
        return pageSize == null || pageSize < 1 ? 10 : pageSize;
    }
}

